home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 20
/
Aminet 20 (1997)(GTI - Schatztruhe)[!][Aug 1997].iso
/
Aminet
/
dev
/
src
/
DICE_SharedLib.lha
/
LibHeader.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-06-23
|
3KB
|
105 lines
//
// Example Shared Library Code
// Compiles with DICE
//
// By Wez Furlong <wez@twinklestar.demon.co.uk>
//
// Based on code by Geert Uytterhoeven and Matt Dillon
//
// This source was produced: Monday 23-Jun-1997
//
// DISCLAIMER
//
// Please read the code FULLY before use... I could have put ANYTHING in
// here; I may have the code format your bootdrive for example.
//
// NEVER trust example code without fully understanding what it does.
//
// This code comes with no warranty; I am NOT responsible for any damage
// that may ensue from its use, be it physical, mental or otherwise.
//
// This code may be modified, so long as the names of myself, Geert and
// Matt are mentioned within any release or distribution produced using it,
// and a copy sent to myself.
//
// This code may be redistributed freely; no profit is allowed to be made
// from its distribution.
//
// This code may be included on an Aminet or Fred Fish CD.
//
//------- Make sure that this is the first module to be linked so that the
//------- end user can't accidentally run it insted of using it properly.
#include "example.h"
//-- Generated by the makefile - change the 'example' to match
//-- the project name in the Dmakefile
#include "example.library_rev.h"
//-- Prohibit accidential execution
LONG StartUp(void)
{
return(-1);
}
//-- Version/Revision Identifiers
//-- Change example to the name of your library
char LibName[] = "example.library";
char LibIDString[] = VSTRING;
UWORD LibVersion = VERSION;
UWORD LibRevision = REVISION;
//-- Vectors for MakeLibrary()
static APTR Vectors[] = {
LibOpen,
LibClose,
LibExpunge,
LibExtFunc,
//-- Library functions:
//-- MUST match the order that they appear in the fd file
PostString,
GetString,
//-- Terminator
(APTR)-1
};
//------ Magic data structures for automatic initialization
//-- Data for MakeLibrary()
static ULONG MakeLibStuff[] = {
sizeof(struct LibraryBase),
(ULONG)Vectors,
0,
(ULONG)LibInit
};
//-- Resident structure for library initialisation
static struct Resident Resident = {
RTC_MATCHWORD, /* word to match on (ILLEGAL) */
&Resident, /* pointer to the above */
&Resident+sizeof(struct Resident),
/* address to continue scan */
RTF_AUTOINIT, /* various tag flags */
VERSION, /* release version number */
NT_LIBRARY, /* type of module (NT_XXXXXX) */
0, /* initialization priority */
LibName, /* pointer to node name */
LibIDString, /* pointer to identification string */
MakeLibStuff /* pointer to init code */
};